<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.text.*"%>
<%@ page import="javax.sql.*"%>
<%@ page import="com.gzgi.framework.*"%>
<%@ page import="com.gzgi.framework.util.*"%>
<%@ page import="com.gzgi.framework.context.*"%>
<%@ page import="com.gzgi.framework.resource.*"%>
<%@ page import="com.gzgi.workflow.jbpm.model.Product"%>
<%
     DataSource dataSource = (DataSource)ContextFactory.getBean("dataSource");
	 String sql = " INSERT INTO JPX_PRODUCT ( " +
	                     " PRODUCTID_, PRODUCTNAME_, PRODUCTCODE_, PRODUCTDATE_, " +
	                     " QUANTITY_, PRICE_, STATUS_, WFSTATUS_ ) " +
	                     " VALUES  (?, ?, ?, ?,?,?, 0, 0)";
	 java.util.Random r = new java.util.Random();
	 Connection con = null;
	 PreparedStatement psmt = null;
	 try{
		 con = dataSource.getConnection();
		 psmt = con.prepareStatement(sql);
		 psmt.setString(1, UUID32.getUUID());
		 psmt.setString(2, "product_"+r.nextInt(1000000));
		 psmt.setString(3, "product_"+r.nextInt(1000000));
		 psmt.setTimestamp(4, DateTools.toTimestamp(new java.util.Date()));
         psmt.setInt(5, r.nextInt(100));
		 psmt.setDouble(6, r.nextInt(10000));
		 psmt.executeUpdate();
		 psmt.close();
		 psmt = null;
	 }catch(Exception ex){
		 ex.printStackTrace();
	 }finally{
       if(con != null){
		   con.close();
	   }
	 }
 %>